fix: use abi.encode for sender in CCIPLocalSimulatorFork v1.6 messages - #63
Conversation
|
Thank you for looking into this. I am not the maintainer, but, based on the repo’s conventions, there are a few things before this commit can be merged. The release playbook states that fixes are pushed to It makes sense to add a regression test: verify that And add an entry to the |
|
Hello @Yurii3721 , thanks for raising the issue, using Chainlink Local and apologies for inconvenience. @Nalon is owning this fix and we will cut the new release as soon as possible. @kurogami-ibrahim79 thank you for opening this PR and willingness to contribute to Chainlink Local. @Yurii3721 is right, we can not merge this to the @Nalon can you please assist with this PR and make sure this is very well tested? Thanks in advance! |
|
@andrejraki Thanks for the explanation regarding the release process. I’ve changed the PR target to the |
|
Thanks for the review, @Yuri3721. I will add a regression test to |
722571c to
f3107fe
Compare
f3107fe to
63cb773
Compare
|
Done. Thanks for the detailed review, @Yurii3721. Regression test: added I also added CHANGELOG: added an entry under Target branch: retargeted to On the fork test / Sepolia → Arb Sepolia CCIP 2.0 note: you were right, the E2E fork test hit All tests pass locally:
Ready for re-review when you have time. Thanks! |
Fixes #62.
Description
This PR addresses the byte-length mismatch for the
senderfield in CCIP v1.6+ simulated messages.Previously,
CCIPLocalSimulatorFork._executePostV1dot6usedabi.encodePacked(message.sender), which produces a 20-byte payload. On production EVM source chains for v1.6 lanes, this field is expected to be a 32-byte ABI word, matching the fix previously applied in #52 forreceiver,destTokenAddress, andsourcePoolAddress.This mismatch caused receiver contracts to revert when executing
abi.decode(message.sender, (address))or to failtrustedRemotevalidations due to byte misalignment.Changes
src/ccip/CCIPLocalSimulatorFork.sol: changedabi.encodePacked(message.sender)toabi.encode(message.sender)in_executePostV1dot6, enforcing a 32-byte ABI word with left-zero padding.test/unit/ccip/CCIPLocalSimulatorForkRouting.t.sol: added regression testtest_executePostV1dot6_senderIs32ByteABIWordwhich drives_executePostV1dot6with a mock OffRamp (MockOffRampCapture) and asserts the capturedsenderis a 32-byte ABI word.CHANGELOG.md: added an entry under### Fixedin theUnreleasedsection.Testing
test_executePostV1dot6_senderIs32ByteABIWordpasses. Before the fix, this test fails becauseabi.encodePackedproduces a 20-byte payload.CCIPLocalSimulatorUnitTestandCCIPLocalSimulatorForkRoutingTestpass locally (forge test --match-path "test/unit/ccip/**/*.sol").Notes
develop(per the release playbook).